package com.passioneffect.collection {
	import flash.events.EventDispatcher;				

	/**
	 * @author Passion Effect
	 */
	public class RangeList extends EventDispatcher {
		private var startItem:ListItem;
		private var endItem:ListItem;
		
		public function RangeList(startItem:ListItem,endItem:ListItem) {
			this.startItem=startItem;
			this.endItem=endItem;	
		}

		public function getStartItem() : ListItem{
			return startItem;
		}
		
		public function setStartItem(item:ListItem):void{
			startItem=item;
		}
		
		public function getEndItem():ListItem{
			return endItem;
		}
		
		public function setEndItem(item:ListItem) : void {
			endItem=item;
		}
		
		public function iterator():RangeListIterator{
			return new RangeListIterator(this);
		}
		
		override public function toString():String{
			var itr:RangeListIterator=iterator();
			var str:String="";
			while(itr.hasNext()){
				str+=itr.next().getData()+"\r";
			}
			return str;
		}
		
	}
}
